//
//  GQProfileCodeController.m
//  GuQu
//
//  Created by HELIUM STAR on 15/5/28.
//  Copyright (c) 2015年 HELIUM STAR. All rights reserved.
//

#import "GQProfileCodeController.h"

@interface GQProfileCodeController ()

@end

@implementation GQProfileCodeController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1.0];
    self.title = @"我的二维码";
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageWithOriginalName:@"distribute_back"] style:UIBarButtonItemStylePlain target:self action:@selector(backToPre)];
    [self setUpChildView];
}

- (void)backToPre
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)setUpChildView
{
    UIView *containView = [[UIView alloc] init];
    containView.x = 10;
    containView.width = 300;
    containView.height = 300;
    containView.y = 10 + kNavigatationBarHeight;
    containView.backgroundColor = [UIColor whiteColor];
    containView.layer.masksToBounds = YES;
    containView.layer.cornerRadius = 5;
    [self.view addSubview:containView];
    
    //创建头像
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageWithRoundName:@"icon"]];
    imageView.x = 10;
    imageView.width = 40;
    imageView.height = 40;
    imageView.y = 35 / 2;
    [containView addSubview:imageView];
    
    //创建姓名
    UILabel *nameLabel = [[UILabel alloc] init];
    nameLabel.x = CGRectGetMaxX(imageView.frame) + 10;
    nameLabel.width = 150;
    nameLabel.height = 15;
    nameLabel.y = imageView.y + 5;
    nameLabel.font = [UIFont systemFontOfSize:15];
    nameLabel.text = @"百丽放羊";
    nameLabel.textColor = [UIColor blackColor];
    [containView addSubview:nameLabel];
    
    //创建头衔
    UILabel *honourLabel = [[UILabel alloc] init];
    honourLabel.x = nameLabel.x;
    honourLabel.y = CGRectGetMaxY(nameLabel.frame);
    honourLabel.width = 200;
    honourLabel.height = 15;
    honourLabel.textColor = [UIColor lightGrayColor];
    honourLabel.text = @"玉石初级玩家";
    honourLabel.font = [UIFont systemFontOfSize:10];
    [containView addSubview:honourLabel];
    
    UIView *lineView = [[UIView alloc] init];
    lineView.x = 0;
    lineView.width = containView.width;
    lineView.height = 1;
    lineView.y = CGRectGetMaxY(imageView.frame) + 17.5;
    lineView.backgroundColor = [UIColor lightGrayColor];
    [containView addSubview:lineView];
    
    UIImageView *codeImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon"]];
    codeImage.width = 180;
    codeImage.height = 180;
    codeImage.x = (containView.width - codeImage.width) / 2;
    codeImage.y = CGRectGetMaxY(lineView.frame) + (containView.height - CGRectGetMaxY(lineView.frame) - codeImage.height) / 2;
    [containView addSubview:codeImage];
    
}


@end
